Public Partial Class FrmDetalleRemitoCompra
    Inherits System.Web.UI.Page
    Public Concepto As CapaDeNegocios.nConcepto = New CapaDeNegocios.nConcepto
    Public Remito As CapaDeNegocios.nRemito = New CapaDeNegocios.nRemito
    Public Proveedor As CapaDeNegocios.nProveedor = New CapaDeNegocios.nProveedor
    Public Condicion As CapaDeNegocios.nCondicion = New CapaDeNegocios.nCondicion
    Public detalle As CapaDeNegocios.nDetalleRemitoCompra = New CapaDeNegocios.nDetalleRemitoCompra
    Dim idRemito As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Session("Login") = "Anonimo" Then
            Response.Redirect("/")
        End If
        If Not Page.IsPostBack Then
            idRemito = Request.QueryString("IdRemito")
            If idRemito <> "" Then
                LLenarDetalle()
            End If
        End If
    End Sub
    Sub LLenarDetalle()
        Dim datos As New DataSet
        Dim i As Integer
        datos = Remito.ListarRemitos(Int(idRemito), "", "", 0, 0, "", "", "")
        For i = 0 To datos.Tables(0).Rows.Count - 1
            LblNumero.Text = datos.Tables(0).Rows(i)("Numero").ToString()
            LblProveedor.Text = Proveedor.DarRazonSocial(datos.Tables(0).Rows(i)("CodigoProveedor").ToString())
            LblCondicion.Text = Condicion.Listar(datos.Tables(0).Rows(i)("CondicionCompra").ToString(), "", 0, "Compra").Tables(0).Rows(0)("Descripcion").ToString()
            LblEstado.Text = datos.Tables(0).Rows(i)("Estado").ToString()
            TxtObservacion.Text = datos.Tables(0).Rows(i)("Observacion").ToString()
        Next
        LlenarGridConcepto()
    End Sub
    Sub LlenarGridConcepto()
        GridDetalle.DataSource = detalle.ListarTodo(0, "", 0, 0, Int(idRemito))
        GridDetalle.DataBind()
    End Sub
End Class